/**
 *
 * @author Bora SAYINER
 * @since Dec 6, 2014 12:37:32 PM
 * @version 1.0
 */
public class MyArray {
	
	private static final int STARTUP_CAPACITY = 16;
	
	private int[] numbers;
	private int index;

	public MyArray() {
		this(STARTUP_CAPACITY);
	}

	public MyArray(int capacity) {
		numbers = new int[capacity];
	}

	public void add(int value) {
		if (index==numbers.length-1) {
			int[] tempArray = new int[numbers.length*2];
			for (int i = 0; i < numbers.length; i++) {
				tempArray[i] = numbers[i];
			}
			numbers = tempArray;
		}
		numbers[index] = value;
		index++;
	}

	public void remove(int index) {
		numbers[index] = 0;
	}

	public int get(int index) {
		return numbers[index];
	}

}
